package com.yuyu.uitlbean;

public class ResultObj<T> {
    private String code;

    private String msg;

    private T data;

    public ResultObj(){
        this.code = MessageCode.SUCCESS.getCode();
        this.msg = MessageCode.SUCCESS.getMsg();
    }

    public ResultObj(String code){
        this.code = code;
    }

    public ResultObj(String message, String code){
        this.msg = message;
        this.code = code;
    }

    public ResultObj(MessageCode messageCode){
        this.code = messageCode.getCode();
        this.msg = messageCode.getMsg();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResultObj{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}
